package com.woniuxy.student.consumer.feginclient;

import com.woniuxy.entity.ResponseResult;
import com.woniuxy.entity.Student;
import com.woniuxy.student.consumer.feginclient.fallback.StudentFeignClientFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author 作者
 * @create 2025-06-30 10:45
 */
@FeignClient(value = "student-provider",fallback = StudentFeignClientFallback.class)
public interface StudentFeignClient {

    @GetMapping("/student/")
    public ResponseResult<List<Student>> getAll();
    @GetMapping("/student/{sid}")
    public ResponseResult<Student> getBySid(@PathVariable("sid") int sid);

    @PostMapping("/student/")
    public ResponseResult<Void> add(@RequestBody Student student);
}
